# coding:utf-8

# 打星星   n = 4   line 1->n
#    *    空格 3210    1->(n-line)
#   ***
#  *****
# ******* 星星j:1->2(line)-1
# range(start, end, step)

n = int(input("Input the line number:"))
print n
for line in range(1, n+1):
    print line
    for i in range(1, n-line+1):
        print " ",
    for j in range(1, 2 * line):
        print "*",
    print ""
